package ai.people.netmon.framework.domain.system.request;

import ai.people.netmon.framework.domain.system.entity.NmSystemRole;
import ai.people.netmon.framework.model.request.PageKeyWordsRequest;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import lombok.Data;
import lombok.EqualsAndHashCode;

/**
 * 角色请求
 *
 * @author zhenglin
 * @since 2022/3/22
 */
@EqualsAndHashCode(callSuper = true)
@Data
public class SysRoleRequest extends PageKeyWordsRequest {


    /**
     * 搜索关键字
     * @ignore
     */
    private String searchKeywords;

    public LambdaQueryWrapper<NmSystemRole> createQuery(){
        LambdaQueryWrapper<NmSystemRole> queryWrapper = Wrappers.lambdaQuery();
        //String searchKeywords = this.getSearchKeywords();
        //if (StringUtils.isNotBlank(searchKeywords)){
        //    queryWrapper.or(x->x.like(NmSystemRole::getName,searchKeywords).or().like(NmSystemRole::getCode,searchKeywords));
        //}
        return queryWrapper;
    }
}
